﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;

namespace RenjianImageViewer.ViewModel.Command
{
    class SaveSingleImageCommand : NotifyChangeCommand
    {
        private RenjianViewModel viewmodel;

        public SaveSingleImageCommand(RenjianViewModel viewmodel)
        {
            this.viewmodel = viewmodel;
            viewmodel.PropertyChanged += (s, e) =>
            {
                if (e.Property == RenjianViewModel.CurrentImageProperty)
                {
                    NotifyCanExecuteChanged();
                }
            };
        }

        public override bool CanExecute(object parameter)
        {
            if (viewmodel.CurrentImage != null)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public override void Execute(object parameter)
        {
            //TODO: Deal with BusyMask, add new properties in SavingStateViewModel.
            return;
        }
    }
}
